<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<button title="red">ok1</button>
		<button title="pink">ok2</button>
		<button title="orange">ok3</button>
		<button title="blue">ok4</button>
		<button title="green">ok5</button>
		<button title="orchid">ok6</button>
	</body>
	<script>
	console.log(this)
	var bts=document.getElementsByTagName("button");
	for(var i=0;i<bts.length;i++){
		bts[i].onclick=function(){
			console.log(this)
			this.style.backgroundColor=this.title
		}
	}
	
	</script>
</html>
